<?php
namespace Company\Controller;
use Think\Controller;

class IndexController extends Controller
{
    public function index()
    {
        //若已创建网站，进入管理页，若无，进入创建页
        $company = $_SESSION['user'];

        $site=D('site');
        $date = $site->where(['cid'=>$company])->select();

        if (!empty($date)){
            $_SESSION['sid'] = $date[0]['id'];
            $this->display();
        }
        else{
            $this->display('/site_add.html');
        }

    }
}